<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AngelScript: Strings</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="aslogo_small.png"/></td>
  <td id="projectalign">
   <div id="projectname">AngelScript
   </div>
  </td>
    <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('doc_datatypes_strings.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div><div class="header">
  <div class="headertitle"><div class="title">Strings </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><dl class="section note"><dt>Note</dt><dd>Strings are only available in the scripts if the application <a class="el" href="doc_addon_std_string.html">registers the support for them</a>. The syntax for using strings may differ for the application you're working with so consult the application's manual for more details.</dd></dl>
<p>Strings hold an array of bytes or 16bit words depending on the application settings. Normally they are used to store text but can really store any kind of binary data.</p>
<p>There are two types of string constants supported in the AngelScript language, the normal quoted string, and the documentation strings, called heredoc strings.</p>
<p>The normal strings are written between double quotation marks (<code>"&lt;/code&gt;) or single quotation marks (&lt;code&gt;'&lt;/code&gt;).
Inside the constant strings some escape sequences can be used to write exact
byte values that might not be possible to write in your normal editor.


&lt;table cellspacing=0 cellpadding=0 border=0&gt;
&lt;tr&gt;&lt;td width=100 valign=top&gt;&lt;b&gt;sequence&lt;/b&gt;&lt;/td&gt;
&lt;td valign=top width=100&gt;&lt;b&gt;value&lt;/b&gt;&lt;/td&gt;
&lt;td valign=top&gt;&lt;b&gt;description&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td width=80 valign=top&gt;&lt;code&gt;\\0&lt;/code&gt;&amp;nbsp;  &lt;/td&gt;
&lt;td valign=top width=50&gt;0&lt;/td&gt;
&lt;td valign=top&gt;null character&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td width=80 valign=top&gt;&lt;code&gt;\\\\&lt;/code&gt;&amp;nbsp;  &lt;/td&gt;
&lt;td valign=top width=50&gt;92&lt;/td&gt;
&lt;td valign=top&gt;back-slash&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td width=80 valign=top&gt;&lt;code&gt;\\'&lt;/code&gt;&amp;nbsp;  &lt;/td&gt;
&lt;td valign=top width=50&gt;39&lt;/td&gt;
&lt;td valign=top&gt;single quotation mark (apostrophe)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td width=80 valign=top&gt;&lt;code&gt;\\"&lt;/code&gt;&amp;nbsp;  &lt;/td&gt;
&lt;td valign=top width=50&gt;34&lt;/td&gt;
&lt;td valign=top&gt;double quotation mark&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td width=80 valign=top&gt;&lt;code&gt;\\n&lt;/code&gt;&amp;nbsp;  &lt;/td&gt;
&lt;td valign=top width=50&gt;10&lt;/td&gt;
&lt;td valign=top&gt;new line feed&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td width=80 valign=top&gt;&lt;code&gt;\\r&lt;/code&gt;&amp;nbsp;  &lt;/td&gt;
&lt;td valign=top width=50&gt;13&lt;/td&gt;
&lt;td valign=top&gt;carriage return&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td width=80 valign=top&gt;&lt;code&gt;\\t&lt;/code&gt;&amp;nbsp;  &lt;/td&gt;
&lt;td valign=top width=50&gt;9&lt;/td&gt;
&lt;td valign=top&gt;tab character&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td width=80 valign=top&gt;&lt;code&gt;\\xFFFF&lt;/code&gt;&amp;nbsp;&lt;/td&gt;
&lt;td valign=top width=50&gt;0xFFFF&lt;/td&gt;
&lt;td valign=top&gt;FFFF should be exchanged for a 1 to 4 digit hexadecimal number representing the value wanted. If the application uses 8bit strings then only values up to 255 is accepted.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td width=80 valign=top&gt;&lt;code&gt;\\uFFFF&lt;/code&gt;&amp;nbsp;&lt;/td&gt;
&lt;td valign=top width=50&gt;0xFFFF&lt;/td&gt;
&lt;td valign=top&gt;FFFF should be exchanged for the hexadecimal number representing the unicode code point&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td width=80 valign=top&gt;&lt;code&gt;\\UFFFFFFFF&lt;/code&gt;&amp;nbsp;&lt;/td&gt;
&lt;td valign=top width=50&gt;0xFFFFFFFF&lt;/td&gt;
&lt;td valign=top&gt;FFFFFFFF should be exchanged for the hexadecimal number representing the unicode code point&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;


&lt;pre&gt;
  string str1 = "This is a string with "escape sequences" .";
  string str2 = 'If single quotes are used then double quotes can be included without "escape sequences".';
&lt;/pre&gt;


The heredoc strings are designed for inclusion of large portions of text
without processing of escape sequences. A heredoc string is surrounded by
triple double-quotation marks (&lt;code&gt;"""</code>), and can span multiple lines of code. If the characters following the start of the string until the first linebreak only contains white space, it is automatically removed by the compiler. Likewise if the characters following the last line break until the end of the string only contains white space this is also removed.</p>
<pre>
  string str = """
  This is some text without "escape sequences". This is some text.
  This is some text. This is some text. This is some text. This is
  some text. This is some text. This is some text. This is some
  text. This is some text. This is some text. This is some text.
  This is some text.
  """;
</pre><p>If more than one string constants are written in sequence with only whitespace or comments between them the compiler will concatenate them into one constant.</p>
<pre>
  string str = "First line.\n"
               "Second line.\n"
               "Third line.\n";
</pre><p>The escape sequences \u and \U will add the specified unicode code point as a UTF-8 or UTF-16 encoded sequence depending on the application settings. Only valid unicode 5.1 code points are accepted, i.e. code points between U+D800 and U+DFFF (reserved for surrogate pairs) or above U+10FFFF are not accepted.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="doc_script_stdlib_string.html">string</a> </dd></dl>
</div></div><!-- contents -->
</div><!-- PageDoc -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Sun May 21 2023 10:12:40 for AngelScript by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
  </ul>
</div>
</body>
</html>
